package com.yuqiao.read.design.templatefun;

import java.util.Arrays;

public class DuckSortTestDrive {

    public static void main(String[] args) {
        Duck[] ducks = {
                new Duck("one",8),
                new Duck("tow",6),
                new Duck("three",10),
                new Duck("four",2),
                new Duck("five",128),
        };

        System.out.println("排序前.........");
        display(ducks);
        Arrays.sort(ducks);
        System.out.println("排序后..........");
        display(ducks);


    }

    public static void display(Duck[] ducks){
        for(Duck duck : ducks){
            System.out.println("ducks = [" + duck + "]");
        }
    }
}
